var vm = new Vue({
    el: "#app2",
    data:{
        host:host,
        user_id: sessionStorage.user_id || localStorage.user_id,
        token: sessionStorage.token || localStorage.token,
        name:'暂无',
        gender:'暂无',
        birth:'暂无',
        mobile:'暂无',
        city:'暂无',
        website:'暂无',
        email:'暂无',
        address: '暂无',

        archives_show:false,
        skill_show: false,
        experience_show: false,
        education_show: false,
    },
    mounted:function () {
        if(this.user_id && this.token){
            axios.get(this.host + '/archives/',{
                headers: {
                    'Authorization': 'JWT ' + this.token
                },
                responseType: 'json'
            })
                .then(response=>{
                    console.log(response.data)
                    if (response.data.name){
                        this.name = response.data.name
                    }else {
                        this.name = '暂无'
                    }
                    if (response.data.gender){
                        this.gender = response.data.gender
                    }else {
                        this.gender = '暂无'
                    }
                    if (response.data.birthdate){
                        this.birth = response.data.birthdate
                    }else {
                        this.birth = '暂无'
                    }
                    if (response.data.mobile){
                        this.mobile = response.data.mobile
                    }else {
                        this.mobile = '暂无'
                    }
                    if (response.data.city){
                        this.city = response.data.city
                    }else {
                        this.city = '暂无'
                    }
                    if (response.data.website){
                        this.website = response.data.website
                    }else {
                        this.website = '暂无'
                    }
                    if (response.data.email){
                        this.email = response.data.email
                    }else {
                        this.email = '暂无'
                    }
                    if (response.data.adderss){
                        this.address = response.data.adderss
                    }else {
                        this.address = '暂无'
                    }
                })
        }

    },
    methods: {

        check_archives: function () {
            this.archives_show = true
        },
        check_skill: function () {
            this.skill_show = true
        },
        check_experience: function () {
            this.experience_show = true
        },
        check_education: function () {
            this.education_show = true

        }

    }
})
